const Mock = require('./mock.js');
console.log(Mock.setup,'====Mock')
var Random = Mock.Random
// Mock.setup({timeout:'50-2000'})

// Random.extend({
//   constellation: function(date) {
//       var constellations = ['白羊座', '金牛座', '双子座', '巨蟹座', '狮子座', '处女座', '天秤座', '天蝎座', '射手座', '摩羯座', '水瓶座', '双鱼座']
//       return this.pick(constellations)
//   }
// })
// Random.constellation()
// // => "水瓶座"
// Mock.mock('@CONSTELLATION')
// // => "天蝎座"
// Mock.mock({
//   constellation: '@CONSTELLATION'
// })

const dataJson = {
  '/login':Mock.mock({

  }),
  '/my/getUserInfo':Mock.mock({

  }),
  '/my/spouseCriterion':Mock.mock({

  }),
  '/homeList':Mock.mock({
    'list|10-30':[{
        'id|+1':0,
        'avatar':"@Image('200x200','@color','#fff','pic')",
        'name':"@cname",
        'realName':Boolean,
        'house':0,
        'job':"@ctitle(4)",
        'income':"@integer(2000,20000)",
        'height':"@integer(140,200)",
        'age':"@integer(18,60)",
        'degree|18-60':20,
        'selfPic|1-5':["@Image('200x200','@color','#fff','pic')"],
      }]
  }),
  '/detail':Mock.mock({
    'id':0,
    'avatar':"@Image('200x200','@color','#fff','pic')",
    'name':"@cname",
    'realName':Boolean,
    'house':0,
    'birthLat':"@county(true)",
    'nowLat':"@county(true)",
    'job':"@ctitle(4)",
    'income':"@integer(2000,20000)",
    'height':"@integer(140,200)",
    'age':"@integer(18,60)",
    'degree|18-60':20,
    'selfPic|1-5':["@Image('200x200','@color','#fff','pic')"],
  }),
  

}
const resultData = (url,method,params,header) => Mock.mock(_url=`/${url.replaceAll('/','\\/')}/`,method,()=>{
  console.log(_url,'---_url')
  return {
    code:0,
    message:'成功',
    data:dataJson[_url.replace(/\/?\//,'/').replace(/\/$/,'')]
  }
})

export default resultData